import request from '@/utils/request'

const baseUrl = 'building'

// 获取数据资产管理列表
export function assetsList(params) {
  return request({
    method: 'get',
    url: baseUrl + '/bimBuilding/queryList',
    params
  })
}

// 资产信息楼栋信息查询
export function buildingInfoQuery(params) {
  return request({
    method: 'get',
    url: baseUrl + '/bimInfoManage/query',
    params
  })
}

// 资产信息顶部信息删除
export function buildingInfoDelete(id) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimInfoManage/delete?pkid=${id}`
  })
}

// 资产信息楼层信息查询
export function floorInfoQuery(params) {
  return request({
    method: 'get',
    url: baseUrl + '/bimBuildManage/query',
    params
  })
}

// 资产信息楼层信息删除
export function floorInfoDelete(id) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimBuildManage/delete?pkid=${id}`
  })
}

// 资产信息管廊信息查询
export function galleryInfoQuery(params) {
  return request({
    method: 'get',
    url: baseUrl + '/bimPipeManage/query',
    params
  })
}

// 资产信息管廊信息删除
export function galleryInfoDelete(id) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimPipeManage/delete?pkid=${id}`
  })
}

// 资产信息保存
export function assetSave(data) {
  return request({
    method: 'post',
    url: baseUrl + '/bimBuilding/saveAll',
    data: data
  })
}

// 设备信息查询
export function deviceInfoQuery(params) {
  return request({
    method: 'get',
    url: baseUrl + '/bimEquipment/query',
    params
  })
}

// 设备信息内层删除
export function deviceInfoDelete(id) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimEquipment/delete?pkid=${id}`
  })
}

// 设备信息外层删除
export function deviceInfoOutDelete(id) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimEquipmentManage/delete?pkid=${id}`
  })
}

// 功能分区查询
export function zoningQuery(params) {
  return request({
    method: 'get',
    url: baseUrl + '/bimFunction/query',
    params
  })
}

// 功能分区删除
export function zoningDelete(id) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimFunction/delete?pkid=${id}`
  })
}

// 导出数据
export function exportData(params) {
  return request({
    method: 'get',
    responseType: 'blob',
    url: baseUrl + '/bimFunction/export',
    params
  })
}

// 上传附件
export function zoningFileAdd(data) {
  return request({
    method: 'post',
    url: baseUrl + '/bimFunction/add/file',
    data
  })
}

// 删除附件
export function zoningFileDelete(id) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimFunction/delete/file?fileId=${id}`
  })
}

// 基础信息新增
export function assetsAdd(data) {
  return request({
    method: 'post',
    url: baseUrl + '/bimBuilding/add',
    data
  })
}

// 基础信息编辑
export function assetsEdit(data) {
  return request({
    method: 'post',
    url: baseUrl + '/bimBuilding/edit',
    data
  })
}

// 基础信息删除
export function assetsDelete(ids) {
  return request({
    method: 'delete',
    url: baseUrl + `/bimBuilding/delete?ids=${ids}`
  })
}

// 楼层统计
export function buildingTotal(params) {
  return request({
    method: 'get',
    url: baseUrl + '/bimBuilding/queryBuildingTotal',
    params
  })
}
